package com.jh.cloud.bus.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringEvent {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();

        context.addApplicationListener(e -> {
            System.err.println("事件：" + e.getClass().getSimpleName());
        });

        context.refresh();
        context.start();
        context.stop();
        context.close();

    }

}
